Import = function() {
	return {
		
		importExcel : function() {
			var path = $.trim($("#filePath").val());
			var suffix = path.substring(path.lastIndexOf('.') + 1, path.length); //suffix:文件后缀
			suffix = suffix.toLowerCase();
			if(null == path || "" == path) {
				Ict.info("请选择要导入的excel文件");
				return;
			} else if("" != suffix && "xls" != suffix) {
				Ict.warn("请选择excel文件(.xls)进行导入");
				return;
			} else {
				$('#importForm').form('submit', {
					url     : '/pc/employee/importAction.htm',
					success : function(data) {
						if("导入成功!" == data) {
							Ict.info("导入成功!", function() {
								Ict.closeWin();
								parent.$("iframe").attr('src', "/pc/employee/main.htm");
				    		});
						} else if("报表导入失败,请稍候重试!" == data) {
							Ict.warn(data);
						} else {
							Ict.info("存在无效数据，导入失败！<br/>详情可在弹窗中下载【数据.xls】查看。");
							Import.fillDownloadTd(data);
						}
					}
				});
			}
		},
		
		fillDownloadTd : function(fileName) {
			var content = 
				"<strong style='line-height: 22px; font-size: 14px;'>查看请点击下载：<br/></strong>&#12288;" + 
				"<a href='/pc/employee/download.htm?fileName=" + fileName + "' style='text-decoration: none;'>" + 
				"	<font color='blue' style='line-height: 25px; font-size: 12px;'>数据.xls</font>" + 
				"</a>";
			$("#dataTd").html(content);
			$("#dataTd").show();
		}
	};
}();

$(function(){
	$("#dataTd").hide();
	$("#dataTd").html("");
});